﻿@model LeadMaster.Models.SurveyCompletion

@{
    ViewBag.Title = "SurveyComplete";
}

<div class="spacer"></div>
@using (Html.BeginForm())
{
    <fieldset style="width: 400px">
    <legend>Survey Completion</legend>
    @Html.HiddenFor(m => m.BlockID)
    @Html.HiddenFor(m => m.Agent)

    <table style="width: 400px">
    <tr>
    <th><label>Did you complete the survey fully ?</label></th>
    <td>
    <select name="FullyCompleted" id="FullyCompleted" style="font-family: 'Trebuchet MS'; font-size: 14px">
    <option value="true" selected>Yes</option>
    <option value="false">No</option>
    </select>
    </td>
    </tr>
    <tr>
    <th><label>If the survey could not be completed, please give details. Or enter other relevant information.</label></th><td>@Html.TextAreaFor(m => m.Note, new { @class = "largetextarea" })</td>
    </tr>
    </table>
    
    
    <div class="spacer"></div>
    <div>
    <input type="submit" value="Save"  id="submitbutton" style="margin-left: 20px" class="bigsubmit"/>
    </div>
    </fieldset>
}

<script type="text/javascript">
    $(document).ready(function () {

        $("#FullyCompleted").blur(function () {
            validate();
        });


        $("#Note").blur(function () {
            validate();
        });

        function validate() {
            if ($("#FullyCompleted").val() == "true" || $("#Note").val() != '') {
                $("#submitbutton").prop('disabled', false);
            }
            else {
                $("#submitbutton").prop('disabled', true);
            }
        }

    });
</script>